# Contributor: Patrycja Rosa <alpine@ptrcnull.me>
# Maintainer: Patrycja Rosa <alpine@ptrcnull.me>
pkgname=py3-zopfli
pkgver=0.2.1
pkgrel=0
pkgdesc="Python bindings to zopfli"
url="https://github.com/fonttools/py-zopfli"
arch="all"
license="Apache-2.0"
depends="python3"
makedepends="python3-dev zopfli-dev py3-wheel py3-setuptools py3-setuptools_scm"
checkdepends="py3-pytest"
source="https://github.com/fonttools/py-zopfli/archive/refs/tags/v$pkgver/py3-zopfli-$pkgver.tar.gz"
builddir="$srcdir/py-zopfli-$pkgver"

export SETUPTOOLS_SCM_PRETEND_VERSION=$pkgver

build() {
	USE_SYSTEM_ZOPFLI=1 python3 setup.py build
}

check() {
	PYTHONPATH=$(echo build/lib.*) pytest
}

package() {
	python3 setup.py install --skip-build --prefix=/usr --root="$pkgdir"
}

sha512sums="
534b4cd133ff7144231a5304b58f4bc046d8cdbb89cf54d7500bea36ec055d18a72cc8de9f56fc3457e71cd6ba4b76cf7f4898543288cd16cfdebe6c2a4812a5  py3-zopfli-0.2.1.tar.gz
"
